package org.bud.util.bit;

/**
 * @author shaun
 * @date 2024/7/18
 * @instruction
 */
public abstract class Strings {

    public static boolean isEmpty(String value){
        return value == null || value.length() == 0;
    }

    public static boolean isNotEmpty(String value){
        return !isEmpty(value);
    }

    public static String capitalize(String value){
        if(isEmpty(value)){
            return value;
        }
        if(Character.isUpperCase(value.charAt(0))){
            return value;
        }
        return new StringBuilder(value)
                .insert(1,Character.toUpperCase(value.charAt(0)))
                .deleteCharAt(0)
                .toString();
    }

}
